<style type="text/css">
		body, html,#allmap {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
		#l-map{height:500px;width:500px;}
		#r-result{width:100%;}
	</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=9zmNfH01GtbwZwWKTskKtncw"></script>
<input type="hidden" name="<?php echo $name?>" id="<?php echo $id?>" value="<?php echo $value?>">
<div id="l-map"></div>
<?php
$point = explode(',', $value);
?>


<script type="text/javascript">
	// 百度地图API功能
	var map = new BMap.Map("l-map");
	var point = new BMap.Point(<?php echo isset($point[0]) && $point[0] ? $point[0] : '116.400244'?>, <?php echo isset($point[1]) && $point[1] ? $point[1] : '39.92556'?>);
	map.centerAndZoom(point, 12);
	map.addControl(new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT}));        
	map.addControl(new BMap.NavigationControl());     
	map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}));
	map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
	map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
	var marker = new BMap.Marker(point);// 创建标注
	map.addOverlay(marker);             // 将标注添加到地图中
	marker.enableDragging();
	marker.addEventListener('dragend', function(e){
		$('#<?php echo $id?>').val(e.point.lng +','+e.point.lat);
	});
	
</script>